<?php defined('_JEXEC') or die('Restricted access'); ?>

<form action="index.php" method="post" name="adminForm" id="adminForm" >
<table>
	<tr>
		<td align="left" width="100%">
			<?php echo JText::_( 'Filter' ); ?>:
			<input type="text" name="search" id="search" value="<?php echo $this->lists['search']; ?>" class="text_area" onchange="document.adminForm.submit();" />
			<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
			<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.getElementById('filter_catid').value='0';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
		</td>
		<td nowrap="nowrap">
			<?php echo $this->lists['state']; ?>
			<?php echo $this->lists['catid']; ?>
		</td>
	</tr>
</table>

<table class="adminlist">
<thead>
	<tr>
		<th width="10">
			<?php echo JText::_( 'NUM' ); ?>
		</th>
		
		<th width="30">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'AUTHOR' ), 'author', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'TEXT' ), 'text', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JText::_( 'IMAGE' ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'CATEGORY NAME' ), 'gallery_id', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'IP ADDRESS' ), 'ip', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th class="title" style="text-align: left;">
			<?php echo JHTML::_('grid.sort', JText::_( 'DATE' ), 'date', $this->lists['order_Dir'], $this->lists['order'] ); ?>
		</th>
		
		<th width="80" nowrap="nowrap">
			<?php echo JHTML::_('grid.sort', JText::_( 'PUBLISHED' ), 'published', $this->lists['order_Dir'], $this->lists['order'] ); ?>	
		</th>
		
		<?php if( !empty($this->moderate) ): ?>
			<th width="5%" nowrap="nowrap">
				<?php echo JText::_( 'MODERATE' ); ?>
			</th>
		<?php endif; ?>
		
	</tr>
</thead>

<?php $footerColumns = empty($this->moderate) ? 9 : 10; ?>
<tfoot>
	<tr>
		<td colspan="<?php echo $footerColumns; ?>" align="center" style="text-align: center">
			<?php echo $this->pagination->getListFooter(); ?>
		</td>
	</tr>
</tfoot>
	
<?php
$k = 0;
$numberComments = count($this->items);

for ($i=0; $i < $numberComments; $i++)
{
	$row = &$this->items[$i];
	
	$checked = JHTML::_('grid.id', $i, $row->id);
	$published 	= JHTML::_('grid.published', $row, $i);
	$moderateImg 	= igHtmlHelper::moderateImage($row, $i, true);	

	?>
	<tr class="<?php echo "row$k"; ?>">
		<td>
			<?php echo $this->pagination->getRowOffset($i); ?>
		</td>
		
		<td>
			<?php echo $checked; ?>
		</td>
	
		<td>
			<?php echo $row->author; ?>
		</td>
		
		<td>
			<?php echo $row->text; ?>
		</td>
		
		<td>
			<img src="<?php echo IG_IMAGE_HTML_RESIZE; ?><?php echo $this->thumbFiles[$i]['folderName']; ?>/<?php echo $this->thumbFiles[$i]['fullFileName']; ?>"
			width="<?php echo $this->thumbFiles[$i]['width']; ?>" height="<?php echo $this->thumbFiles[$i]['height'] ?>" alt="<?php echo $row->alt_text; ?>"/>
		</td>
		
		<td>
			<?php echo $row->name; ?>
		</td>
		
		<td>
			<?php echo $row->ip; ?>
		</td>
		
		<td>
			<?php echo date(" G:i j/m/Y",$row->date); ?>
		</td>
		
		<td align="center">
			<?php echo $published;?>
		</td>
		
		<?php if( !empty($this->moderate) ): ?>
			<td align="center">
				<?php echo $moderateImg; ?>
			</td>	
		<?php endif; ?>
		
	</tr>
<?php
$k = 1 - $k;
}
?>


</table>

<input type="hidden" name="option" value="com_igallery" />
<input type="hidden" name="controller" value="igcomment" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
</form>

